/*全部分类的展示！！！ */
var qb = document.getElementById("qb");
var hideqb = document.getElementById("hideqb");
var show = document.getElementById("show");
qb.onclick = function () {
    console.log(show.src);
    if (show.src == "http://localhost:3000/publics/front-stage/img/show.png") {
        show.src = "http://localhost:3000/publics/front-stage/img/hide.png"
    } else {
        show.src = "http://localhost:3000/publics/front-stage/img/show.png";
    }
    if (hideqb.style.display == "none") {
        hideqb.style.display = "block";

    } else {
        hideqb.style.display = "none";
    }
}

/*vip */
var vipbz = document.getElementById("vipbz");
var vipts = document.getElementById("vipts");
vipbz.onmouseover = function () {
    vipts.style.display = "block"
}
vipbz.onmouseout = function () {
    vipts.style.display = "none"
}
vipbz.onclick = function () {
    /*点击之后开通vip的弹窗出现！！！！ */
    cover.style.display = "block";   //显示遮罩层
    modal.style.display = "block";   //显示弹出层
}

/*轮播图 */
var btn = document.getElementById("btn");
var hhh = document.getElementById("hhh");
var leftbtn = document.getElementById("leftbtn");
btn.onclick = function () {
    hhh.style.marginLeft = "-645px";
    hhh.style.transition = "all 1s";
    btn.style.display = "none";
    leftbtn.style.display = "block";
}
leftbtn.onclick = function () {
    hhh.style.marginLeft = "0px";
    hhh.style.transition = "all 1s";
    btn.style.display = "block";
    leftbtn.style.display = "none";
}

/*切换账号的操作！！！！ */
var toontherzh = document.getElementById("toontherzh");
var morezhcover = document.getElementById("morezhcover");
var morezh = document.getElementById("morezh");
toontherzh.onclick = function () {
    morezhcover.style.display = "block";
    morezh.style.display = "block";
}

var closemorezh = document.getElementById("closemorezh");
closemorezh.onclick = function () {
    morezhcover.style.display = "none";
    morezh.style.display = "none";
}
var nomore = document.getElementById("nomore");
nomore.onclick = function () {
    morezhcover.style.display = "none";
    morezh.style.display = "none";
}
/*vip充值服务类型！！！ */
var allwaysdivs = document.getElementById("hhh").querySelectorAll("div");
var allwaysbuttons = document.getElementById("hhh").querySelectorAll("button");
console.log(allwaysdivs)
var words = document.getElementById("words");
/*循环遍历这几个div */
for (let i = 0; i < allwaysdivs.length; i++) {
    allwaysdivs[i].onclick = function () {
        console.log(i);
        for (let i = 0; i < allwaysdivs.length; i++) {
            allwaysdivs[i].style.background = "none";
            allwaysbuttons[i].style.background = "none";
        }
        allwaysbuttons[i].style.background = "linear-gradient(120deg,#fff7ec,#ffcb7e)";
        allwaysdivs[i].style.background = "linear-gradient(120deg,#fff7ec,#ffcb7e)";
        if (i == 0) {
            words.innerHTML = "到期将按每年218元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        } else if (i == 1) {
            words.innerHTML = "到期将按每季58元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        } else if (i == 2) {
            words.innerHTML = "到期将按每月19元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        } else if (i == 3) {
            words.innerHTML = "到期将按每月20元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        } else if (i == 4) {
            words.innerHTML = "到期将按每月24元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        } else {
            words.innerHTML = "到期将按每月25元自动续费，可随时取消，已签约连包的用户购买则将以新签约的价格续费。"
        }
    }
}



/*开通会员德弹窗 */
var cover = document.querySelector("#cover");
var modal = document.querySelector("#modal");
var closes = document.getElementById("closes");
var wlcover = document.getElementById("wlcover");
var wl = document.getElementById("wl");
closes.onclick = function () {
    /*出现一个挽留的弹窗！！！！ */
    wlcover.style.display = "block";   //显示遮罩层
    wl.style.display = "block";   //显示弹出层
    var yesclose = document.getElementById("yesclose");
    var noclose = document.getElementById("noclose");
    yesclose.onclick = function () {
        cover.style.display = "none";
        modal.style.display = "none";
        wlcover.style.display = "none";   //显示遮罩层
        wl.style.display = "none";   //显示弹出层
    }
    noclose.onclick = function () {
        wlcover.style.display = "none";   //显示遮罩层
        wl.style.display = "none";   //显示弹出层
    }
}
/*复制粘贴过来即可 */